<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>7.1.2 P69 外部共享</title>
</head>
<body>
<div id="app">
    <my-component></my-component>
    <my-component></my-component>
    <my-component></my-component>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script>
    var data = {
        conunter:0
    };

    Vue.component('my-component',{
        template:'<button @click="counter++">{{ counter }}</button>',
        data: function (){
            return{
                counter:0
            };
        }
    });
    var app = new Vue({
        el:'#app'
    })
</script>
</body>
</html>